package com.wzh.controll;

import com.wzh.pojo.Po.Treemenu;

import com.wzh.pojo.Resp.DataResp;
import com.wzh.service.RouterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Router")
public class RouterController {
	@Autowired
	private RouterService routerService;
	@PostMapping("/ShowRouter")
	@ResponseBody
	public DataResp show(){
		DataResp<Object> resp= routerService.show();
		return resp;
	};

//	@PostMapping("/ShowRouter")
//	@ResponseBody
//	public DataResp showBytype(@RequestBody Users users){
//		DataResp<Object> resp= routerService.showBytype(users);
//		return resp;
//	};

	@PostMapping("/AddRouter")
	@ResponseBody
	public DataResp AddRouter(@RequestBody Treemenu router){
		System.out.println(router);
		DataResp<Object> resp= routerService.add(router);
		return resp;
	};

	@PostMapping("/DelRouter")
	@ResponseBody
	public DataResp DelRouter(@RequestBody Treemenu router){
		DataResp<Object> resp= routerService.del(router);
		return resp;
	};
}
